Skip to content

Translations ("i18n", "l10n")

olf edited this page May 11, 2025 · 17 revisions

Introduction

Do mind the definitions in the glossary on the "Terms and wording" wiki page. These comprehensive definitions (in English) might also be helpful to properly determine the corresponding terms in other languages.

Please use the discussion thread "Problematic source strings for translation" for feedback and criticism with regard to source strings (in English) and the aforementioned glossary.

Translating Patches

Creating multilingual Patches

Add appropriate import statement to your Patch:

import org.SfietKonstantin.patchmanager 2.0

Add property pmTranslationLoaded to the root object of your Patch:

property bool pmTranslationLoaded: PatchManagerTranslator ? PatchManagerTranslator.installTranslator("name-of-your-patch") : false

Change most visible text to [ToDo: Understand & describe, what this is about, e.g. "Emit different text, when a translation was successfully loaded"?]:

pmTranslationLoaded ? qsTr("Normal text if all is okay") : "Please update patchmanager!"

Original sources

Translating Patchmanager

Do read and optionally follow the links of the resolution of issue #27.
A suggestion in a new issue for a paragraph which integrates this information here will be highly appreciated.

Qt utilities

Qt Linguist

https://doc.qt.io/qt-5/linguist-manager.html

lupdate

https://linux.die.net/man/1/lupdate

The specific command for updating Patchmanager's translation source TS file from the source strings proper is (all translatable source strings are beneath the src directory): lupdate src -ts translations/settings-patchmanager.ts
Note that on e.g. OpenSUSE, installing Qt5 Linguist does not add /usr/lib64/qt5/bin to the search path, hence one has to use: /usr/lib64/qt5/bin/lupdate [-no-obsolete] src -ts translations/settings-patchmanager.ts

lrelease

https://linux.die.net/man/1/lrelease

Transifex

https://app.transifex.com/

https://app.transifex.com/coderus/patchmanager3/

https://app.transifex.com/coderus/patchmanager3/languages/

https://app.transifex.com/coderus/patchmanager3/content/

Clone this wiki locally